<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1.基本列表</title>
    <!--  引入Vue  -->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!--  准备好一个容器  -->
    <div id="root">
        <h2>人员列表</h2>
        <ul>
            <li v-for="p in persons" :key="p.id">
                {{p.name}}-{{p.age}}
            </li>

        </ul>
    </div>
</body>

<script type="text/javascript">
    new Vue({
        el:'#root',
        data:{
            persons:[
                {id:'001',name:'why',age:18},
                {id:'002',name:'kobe',age:24},
                {id:'003',name:'james',age:30}
            ]
        }
    })
</script>
</html>